
    import '@/assets/less/TableExpand.less'
    import { mixinDevice } from '@/utils/mixin'
    import { JeecgListMixin } from '@/mixins/JeecgListMixin'
    import CtNoticeModal from './modules/CtNoticeModal'
    import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
    import {doRelease, doReovke} from '@/api/api'     //.set('@api', resolve('src/api')) 表示@api指的是“src/api”
    import {getAction} from "@/api/manage";

    export default {
    name: 'CtNoticeList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
    CtNoticeModal
},
    data () {
    return {
    title:'',
    time:'',
    params:{
    pageNo: 1,
    pageSize: 10,
    title:"",
    senddate:"",
},
    description: '公告查询页面',
    release_url:"/ctms/ctNotice/ReleaveData"  ,//公告地址
    dataList:"",
    all:"",  //总页数
    cur:"",  //当前页数
    totalpage:"" ,//当前条数
    url: {
    list: "/ctms/ctNotice/ReleaveData"
},
    dictOptions:{},
    superFieldList:[],
}
},

    methods: {

    //请求数据

    loadData(){
    getAction(this.release_url,this.params).then((res)=>{
    this.dataList=[];
    for(let i=0;i<res.result.records.length;i++){
    this.dataList.push(res.result.records[i])
}
    this.all = res.result.pages;
    this.cur = res.result.current;
    this.totalpage = res.result.total;

})
},

    searchReset(){

    this.params.senddate='';
    this.params.title = '';
    this.params.pageNo = 1;
    this.params.pageSize = 10;
    this.title = '';
    this.time = '';

    getAction(this.release_url,this.params).then((res)=>{
    this.dataList=[];
    for(let i=0;i<res.result.records.length;i++){
    this.dataList.push(res.result.records[i])
}
    this.all = res.result.pages;
    this.cur = res.result.current;
    this.totalpage = res.result.total;

})

},
    //查询值
    TitleInput(value){
    this.params.title = value.target.value;
    this.title = value.target.value;

},

    //查询值
    DateInput(date, dateString){
    this.params.senddate = dateString;
    this.time = dateString;

},

    //分页
    btnClick: function(data){//页码点击事件
    if(data != this.cur){
    this.cur = data
}
    //根据点击页数请求数据
    this.params.pageNo = this.cur
    this.loadData();
},

    pageClick: function(){
    //根据点击页数请求数据
    this.params.pageNo = this.cur
    this.loadData();
}


},

    computed: {
//分页
    indexs: function(){
    var left = 1;
    var right = this.all;
    var ar = [];
    if(this.all>= 5){
    if(this.cur > 3 && this.cur < this.all-2){
    left = this.cur - 2
    right = this.cur + 2
}else{
    if(this.cur<=3){
    left = 1
    right = 5
}else{
    right = this.all
    left = this.all -4
}
}
}
    while (left <= right){
    ar.push(left)
    left ++
}
    return ar
}
},
    created() {
    //调用方法
    this.loadData();
},

}